#===-- Makefile.config - Local configuration for LLVM ------*- Makefile -*--===#
#
#                     The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===------------------------------------------------------------------------===#
#
# This file is included by Makefile.common.  It defines paths and other
# values specific to a particular installation of LLVM.
#
#===------------------------------------------------------------------------===#

# Define LLVM specific info and directories based on the autoconf variables
LLVMPackageName   := llvm
LLVMVersion       := 2.9
LLVM_CONFIGTIME   := Fri Dec 30 21:02:46 IST 2011

###########################################################################
# Directory Configuration
#	This section of the Makefile determines what is where.  To be
#	specific, there are several locations that need to be defined:
#
#	o LLVM_SRC_ROOT  : The root directory of the LLVM source code.
#	o LLVM_OBJ_ROOT  : The root directory containing the built LLVM code.
#
#	o PROJ_SRC_DIR  : The directory containing the code to build.
#	o PROJ_SRC_ROOT : The root directory of the code to build.
#
#	o PROJ_OBJ_DIR  : The directory in which compiled code will be placed.
#	o PROJ_OBJ_ROOT : The root directory in which compiled code is placed.
#
###########################################################################

PWD := /bin/pwd
# Set the project name to LLVM if its not defined
ifndef PROJECT_NAME
PROJECT_NAME := $(LLVMPackageName)
endif

# The macro below is expanded when 'realpath' is not built-in.
# Built-in 'realpath' is available on GNU Make 3.81.
realpath = $(shell cd $(1); $(PWD))

PROJ_OBJ_DIR  := $(call realpath, .)
PROJ_OBJ_ROOT := $(call realpath, $(PROJ_OBJ_DIR)/$(LEVEL))

ifeq ($(PROJECT_NAME),llvm)
LLVM_SRC_ROOT   := $(call realpath, /Users/michaelkiperberg/llvm-prefetch/llvm-2.9)
LLVM_OBJ_ROOT   := $(call realpath, /Users/michaelkiperberg/llvm-prefetch/llvm-2.9)
PROJ_SRC_ROOT   := $(LLVM_SRC_ROOT)
PROJ_SRC_DIR    := $(call realpath, $(LLVM_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)))
prefix          := /usr/local
PROJ_prefix     := $(prefix)
PROJ_VERSION    := $(LLVMVersion)
else
ifndef PROJ_SRC_ROOT
$(error Projects must define PROJ_SRC_ROOT)
endif
ifndef PROJ_OBJ_ROOT
$(error Projects must define PROJ_OBJ_ROOT)
endif
ifndef PROJ_INSTALL_ROOT
$(error Projects must define PROJ_INSTALL_ROOT)
endif
ifndef LLVM_SRC_ROOT
$(error Projects must define LLVM_SRC_ROOT)
endif
ifndef LLVM_OBJ_ROOT
$(error Projects must define LLVM_OBJ_ROOT)
endif
PROJ_SRC_DIR := $(call realpath, $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)))
prefix          := $(PROJ_INSTALL_ROOT)
PROJ_prefix     := $(prefix)
ifndef PROJ_VERSION
PROJ_VERSION := 1.0
endif
endif

LLVMMAKE := $(LLVM_SRC_ROOT)/make

PROJ_bindir     := $(PROJ_prefix)/bin
PROJ_libdir     := $(PROJ_prefix)/lib
PROJ_datadir    := $(PROJ_prefix)/share
PROJ_docsdir    := $(PROJ_prefix)/docs/llvm
PROJ_etcdir     := $(PROJ_prefix)/etc/llvm
PROJ_includedir := $(PROJ_prefix)/include
PROJ_infodir    := $(PROJ_prefix)/info
PROJ_mandir     := $(PROJ_prefix)/share/man

# Determine if we're on a unix type operating system
LLVM_ON_UNIX:=1
LLVM_ON_WIN32:=0

# Host operating system for which LLVM will be run.
OS=Darwin
HOST_OS=Darwin
# Target operating system for which LLVM will compile for.
TARGET_OS=Darwin

# Target hardware architecture
ARCH=x86_64

# Indicates, whether we're cross-compiling LLVM or not
LLVM_CROSS_COMPILING=0

# Executable file extension for build platform (mainly for
# tablegen call if we're cross-compiling).
BUILD_EXEEXT=

# Compilers for the build platflorm (mainly for tablegen
# call if we're cross-compiling).
BUILD_CC=
BUILD_CXX=

# Triple for configuring build tools when cross-compiling
BUILD_TRIPLE=x86_64-apple-darwin10.8.0

# Target triple (cpu-vendor-os) for which we should generate code
TARGET_TRIPLE=x86_64-apple-darwin10.8.0

# Extra options to compile LLVM with
EXTRA_OPTIONS=

# Endian-ness of the target
ENDIAN=little

# Path to the C++ compiler to use.  This is an optional setting, which defaults
# to whatever your gmake defaults to.
CXX = g++

# Path to the CC binary, which use used by testcases for native builds.
CC := gcc

# Linker flags.
LDFLAGS+=

# Path to the library archiver program.
AR_PATH = ar
AR = ar

# Path to the nm program
NM_PATH = /usr/bin/nm

# The pathnames of the programs we require to build
CMP        := /usr/bin/cmp
CP         := /bin/cp
DATE       := /bin/date
FIND       := /usr/bin/find
GREP       := /usr/bin/grep
INSTALL    := /usr/bin/install -c
MKDIR      := $(LLVM_SRC_ROOT)/autoconf/mkinstalldirs
MV         := /bin/mv
RANLIB     := ranlib
RM         := /bin/rm
SED        := /usr/bin/sed
TAR        := /sw/bin/tar

# Paths to miscellaneous programs we hope are present but might not be
PERL       := /opt/local/bin/perl
BZIP2      := /sw/bin/bzip2
CAT        := /bin/cat
DOT        := echo dot
DOXYGEN    := 
GROFF      := /usr/bin/groff
GZIPBIN    := /sw/bin/gzip
OCAMLC     := 
OCAMLOPT   := 
OCAMLDEP   := 
OCAMLDOC   := 
GAS        := /usr/bin/as
POD2HTML   := /opt/local/bin/pod2html
POD2MAN    := /opt/local/bin/pod2man
PDFROFF    := /usr/bin/pdfroff
RUNTEST    := 
TCLSH      := /usr/bin/tclsh8.4
ZIP        := /usr/bin/zip

HAVE_PERL    := 1
HAVE_PTHREAD := 1

LIBS       := -lpthread -lm 

# Targets that we should build
TARGETS_TO_BUILD=X86 Sparc PowerPC Alpha ARM Mips CellSPU XCore MSP430 SystemZ Blackfin CBackend CppBackend MBlaze PTX

# Path to location for LLVM C/C++ front-end. You can modify this if you
# want to override the value set by configure.
LLVMGCCDIR := /usr/llvm-gcc-4.2/bin/..

# Full pathnames of LLVM C/C++ front-end 'cc1' and 'cc1plus' binaries:
LLVMGCC  := /usr/bin/llvm-gcc
LLVMGXX  := /usr/bin/llvm-g++
LLVMCC1  := /usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/cc1
LLVMCC1PLUS := /usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/cc1plus
LLVMGCC_LANGS := c,objc,c++,obj-c++
LLVMGCC_DRAGONEGG := no

# Information on Clang, if configured.
CLANGPATH := 
CLANGXXPATH := 
ENABLE_BUILT_CLANG := 0

# The LLVM capable compiler to use.
LLVMCC_OPTION := llvm-gcc

# The flag used to emit LLVM IR.
LLVMCC_EMITIR_FLAG = -emit-llvm
LLVMCC_DISABLEOPT_FLAGS := -mllvm -disable-llvm-optzns

# Path to directory where object files should be stored during a build.
# Set OBJ_ROOT to "." if you do not want to use a separate place for
# object files.
OBJ_ROOT := .

# What to pass as rpath flag to g++
RPATH := -Wl,-rpath

# What to pass as -rdynamic flag to g++
RDYNAMIC := 

# These are options that can either be enabled here, or can be enabled on the
# make command line (ie, make ENABLE_PROFILING=1):

# When ENABLE_OPTIMIZED is enabled, LLVM code is optimized and output is put
# into the "Release" directories. Otherwise, LLVM code is not optimized and
# output is put in the "Debug" directories.
#ENABLE_OPTIMIZED = 1


# When ENABLE_PROFILING is enabled, profile instrumentation is done
# and output is put into the "<Flavor>+Profile" directories, where
# <Flavor> is either Debug or Release depending on how other build
# flags are set. Otherwise, output is put in the <Flavor>
# directories.
#ENABLE_PROFILING = 1


# When DISABLE_ASSERTIONS is enabled, builds of all of the LLVM code will
# exclude assertion checks, otherwise they are included.
#DISABLE_ASSERTIONS = 1


# When ENABLE_EXPENSIVE_CHECKS is enabled, builds of all of the LLVM
# code will include expensive checks, otherwise they are excluded.
#ENABLE_EXPENSIVE_CHECKS = 0


# When DEBUG_RUNTIME is enabled, the runtime libraries will retain debug
# symbols.
#DEBUG_RUNTIME = 1


# When DEBUG_SYMBOLS is enabled, the compiler libraries will retain debug
# symbols.
#DEBUG_SYMBOLS = 1


# The compiler flags to use for optimized builds.
OPTIMIZE_OPTION := -O3

# When ENABLE_PROFILING is enabled, the llvm source base is built with profile
# information to allow gprof to be used to get execution frequencies.
#ENABLE_PROFILING = 1

# When ENABLE_DOCS is disabled, docs/ will not be built.
ENABLE_DOCS = 1

# When ENABLE_DOXYGEN is enabled, the doxygen documentation will be built
ENABLE_DOXYGEN = 0

# Do we want to enable threads?
ENABLE_THREADS := 1

# Do we want to build with position independent code?
ENABLE_PIC := 1

# Do we want to build a shared library and link the tools with it?
ENABLE_SHARED := 0

# Do we want to link the stdc++ into a shared library? (Cygming)
ENABLE_EMBED_STDCXX := 1

# Use -fvisibility-inlines-hidden?
ENABLE_VISIBILITY_INLINES_HIDDEN := 1

# Do we want to allow timestamping information into builds?
ENABLE_TIMESTAMPS := 1

# This option tells the Makefiles to produce verbose output.
# It essentially prints the commands that make is executing
#VERBOSE = 1

# Enable JIT for this platform
TARGET_HAS_JIT = 1

# Environment variable to set to change the runtime shared library search path.
SHLIBPATH_VAR = DYLD_LIBRARY_PATH

# Shared library extension for host platform.
SHLIBEXT = .dylib

# Executable file extension for host platform.
EXEEXT = 

# Things we just assume are "there"
ECHO := echo

# Get the options for causing archives to link all their content instead of
# just missing symbols, and the inverse of that. This is used for certain LLVM
# tools that permit loadable modules. It ensures that the LLVM symbols will be
# available to those loadable modules.
LINKALL := -Wl,-all_load
NOLINKALL := -Wl,-noall_load

# Get the value of HUGE_VAL_SANITY which will be either "yes" or "no" depending
# on the check.
HUGE_VAL_SANITY = yes

# Bindings that we should build
BINDINGS_TO_BUILD := 
ALL_BINDINGS      := ocaml
OCAML_LIBDIR      := 

# When compiling under Mingw/Cygwin, executables such as tblgen
# expect Windows paths, whereas the build system uses Unix paths.
# The function SYSPATH transforms Unix paths into Windows paths.
ifneq (,$(findstring -mno-cygwin, $(CXX)))
  SYSPATH = $(shell echo $(1) | cygpath -m -f -)
else
  SYSPATH = $(1)
endif

# Location of the plugin header file for gold.
BINUTILS_INCDIR := 

# When ENABLE_LLVMC_DYNAMIC is enabled, LLVMC will link libCompilerDriver
# dynamically. This is needed to make dynamic plugins work on some targets
# (Windows).
ENABLE_LLVMC_DYNAMIC = 0
#@ENABLE_LLVMC_DYNAMIC@

# When ENABLE_LLVMC_DYNAMIC_PLUGINS is enabled, LLVMC will have dynamic plugin
# support (via the -load option).
ENABLE_LLVMC_DYNAMIC_PLUGINS = 1
#@ENABLE_LLVMC_DYNAMIC_PLUGINS@

# Optional flags supported by the compiler
# -Wno-missing-field-initializers
NO_MISSING_FIELD_INITIALIZERS = -Wno-missing-field-initializers
# -Wno-variadic-macros
NO_VARIADIC_MACROS = -Wno-variadic-macros

# Was polly found in tools/polly?
LLVM_HAS_POLLY = 
# Flags supported by the linker.
# bfd ld / gold --version-script=file
HAVE_LINK_VERSION_SCRIPT = 
